<template>
	  <div class="dealBuyWrap">
	  	<v-Contentout>
		    <v-dealTopNav></v-dealTopNav>
		    <v-dealChartTab></v-dealChartTab>
		    <div v-show="flag" class="main">
		        <div><p>今开&nbsp;&nbsp;<span class="green">{{data.open_price}}</span></p><p>昨收&nbsp;&nbsp;<span>{{data.prev_price}}</span></p><p>振幅&nbsp;&nbsp;<span class="red">{{data.swing}}%</span></p></div>
		        <div><p>涨停&nbsp;&nbsp;<span class="red">{{data.upStop}}</span></p><p>跌停&nbsp;&nbsp;<span class="green">{{data.downStop}}</span></p><p>最高&nbsp;&nbsp;<span class="red">{{data.high_price}}</span></p></div>
		        <div><p>最低&nbsp;&nbsp;<span>{{data.low_price}}</span></p><p>成交量&nbsp;&nbsp;<span>{{data.business_amount}}万手</span></p><p>成交额&nbsp;&nbsp;<span>{{data.business_balance}}亿元</span></p></div>
		        
		    </div>
	    </v-Contentout>
	    <div class="bottomButton" >
	      <span  @click='toBuy(data)' :class="data.status==0? 'action' :'' " >{{data.status | doTo}}</span>
	    </div>
	  </div>
</template>

<script>
import dealContent from './dealContent'
import dealTopNav from './dealTopNav'
import dealChartTab from './chart/dealChartTab'
import tdOrTa from './tdOrTa'
import TextRightArrowList from '../TextRightArrowList'
import deal from '@/api/deal/index'
import { toast} from '@/util/index'
import Content from '@/components/ContentBottom2'
import Contentout from '@/components/ContentBottom3'
	export default {
	  data() {
	    return {
	      item: {
	        src: '',
	        text: 'T+D A股玩法规则',
	        tips: '',
	      },
	      loginName:"",
	      modeTypes: '市场委托',
	      prices: 20,
	      numbers: 0,
	      flag:true,
	      data:""
	    }
	  },
	  computed: {
	    totalPrices() {
	      return this.prices * this.numbers
	    }
	  },
	  filters:{
				doTo(value){
					 if(value==0){
					 		return "立即点买"
					 }else if(value==1){
					 		return "停盘"
					 }else if(value==2){
					 		return "暂时停盘"
					 }else if(value==3){
					 		return "风险股"
					 }else if(value==4){
					 		return "非交易时段"
					 }else if(value==5){
					 		return "风险股"
					 }else if(value==6){
					 		return "风险股";
					 }
				}
	  },
	  components: {
	    'dealContent': dealContent,
	    'v-dealTopNav': dealTopNav,
	    'v-dealChartTab': dealChartTab,
	    'v-tdOrTa': tdOrTa,
	    'v-TextRightArrowList': TextRightArrowList,
	    'v-Content': Content,
	    'v-Contentout':Contentout
	  },
	  methods: {
	    toRules() {
	      console.log('toRules')
	    },
	    chose(value){
		    	if(value==1){
		    		 return true;
		    	}else{
		    		return false;
		    	
		    	}
	    },
	    toBuy(data) {
	    	if(data.status==0){
		    		this.$router.push({
		    					path:"/toBuy",
		    					query: {
		                "equityCode": data.stock_code,
		                "equityName":data.code_name
		            	}
		    		});
	    	}
	    },
	    
	    
	  },
	  mounted() {
	  	
	  		 //this.data=this.$store.state.buyArr;
	  		//console.log(this.data.isTrade);
		
	  
		},
		computed: {
		  getUserData() {
		    return this.data=this.$store.state.buyArr;
		    
		  }
		},
		watch: {
		  getUserData(val) {
		    this.data = val;
		  }
		}
  }
</script>

<style lang="less" scoped>
@import '../../less/config.less';
.dealBuyWrap {
  width: 100%;
  height: 100%;
  padding-bottom: 1.76rem;
  .main{
  		padding:0 @p30;
  		color:#56627c;
  		height:2.4rem;
  		display: flex;
  		justify-content: space-around;
  		align-items: flex-start;
  		flex-direction: column;
  		background:#141723;
  		margin-bottom: @fsize;
  		div{
  			font-size:@f24;
  			width: 100%;
  			display: flex;
  			justify-content: space-between;
  			align-items: center;
  			p{
  				width: 2.9rem;
  				span{
  					color: white;
  				}
  				.green{
  					color: #33ffc3;
  				}
  				.red{
  					color: #FF335B;
  				}
  					
  			}
  		}
  }
  
  
	  .bottomButton {
		  width: 100%;
		  height: 1.76rem;
		  line-height: 1.76rem;
		  position: absolute;
		  bottom: 0;
		  z-index: 9999;
		  background-color: @liBg;
		  text-align: center;
		  font-size: .48rem;
		  span {
		    display: inline-block;
		    width: 9.2rem;
		    height: 1.17333rem;
		    line-height: 1.17333rem;
		    background-color:#CCCCCC;
		    color:white;
		    border-radius: 0.08rem;
		  }
		  
		   .action{
		 	
		    background-color: #ffdd25;
		    color:#8d4006;
		  }
		 
		}
		
  
  
}


</style>
